package br.com.abril.sforce;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface SalesForceProfileRepository extends JpaRepository<SalesForceProfile, Long>, JpaSpecificationExecutor<SalesForceProfile> {

	List<SalesForceProfile> findByStatus(SalesForceProfile.ProfileStatus status);

	@Modifying
	@Query("update SalesForceProfile u set u.status = 'DISABLED'")
	int disableAllProfiles();
	
	
}
